import config from "@/config"
import http from "@/utils/request"

export default {
	importDataBase: {
		url: `${config.API_URL}/core/report/importDb/importData`,
		name: "下载文件",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		}
	},
	uploadfile: {
		url: `${config.API_URL}/core/system/file/downloadFile`,
		name: "上传文件",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, { responseType: 'blob'});
		}
	},
	systemDelete: {
		url: `${config.API_URL}`,
		name: "动态修改删除",
		post: async function (url, data, config = {}) {
			return await http.post(this.url + url, data, config);
		}

	},
	dic: {
		tree: {
			url: `${config.API_URL}/system/dic/tree`,
			name: "获取字典树",
			get: async function () {
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/system/dic/list`,
			name: "字典明细",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		get: {
			url: `${config.API_URL}/system/dic/get`,
			name: "获取字典数据",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	},
	create: {
		form: {
			url: `${config.API_URL}/core/reportCoreService/create`,
			name: "创建表单",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		}
	},
	select: {
		query: {
			url: `${config.API_URL}/core/reportCoreService/query`,
			name: "获取查询报表",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		}
	},


	// 表格的增删改查
	tableReq: {
		url: `${config.API_URL}`,
		name: "表格",
		post: async function (url, data, config = {}) {
			console.log('-----url', this.url, this.url + url)
			return await http.post(this.url + url, data, config);
		}
	},

	// 表格导出
	export: {
		url: `${config.API_URL}/core/reportCoreService/export`,
		name: "表格",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		}
	},
	report: {
		selectCompanyList: {
			url: `${config.API_URL}/core/reportCoreService/create`,
			name: "查询列表",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
	},
	selectTable: {
		url: `${config.API_URL}/core/reportCoreService/simpleQuery`,
		name: "查询列表",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		},
	},
	//语言设置
	lang: {
		add: {
			url: `${config.API_URL}/main/system/lang/add`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/main/system/lang/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		detail: {
			url: `${config.API_URL}/main/system/lang/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/main/system/lang/update`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
	},
	//字典类别
	codekind: {
		detail: {
			url: `${config.API_URL}/main/system/codekind/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/main/system/codekind/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/main/system/codekind/update`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},

		add: {
			url: `${config.API_URL}/main/system/codekind/add`,
			name: "添加",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}

		},
		addSysCodes: {
			url: `${config.API_URL}/main/system/syscode/batchUpdate`,
			name: "批量添加字典表",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		initSysCodes: {
			url: `${config.API_URL}/main/system/syscode/queryByCodeKindId`,
			name: "按类型查询字典表",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		CodeKindTree: {
			url: `${config.API_URL}/core/reportCoreService/query`,
			name: "字典树状图",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},


	},
	//字典表
	syscode: {
		detail: {
			url: `${config.API_URL}/core/system/syscode/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/core/system/syscode/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/core/system/syscode/update`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},

		add: {
			url: `${config.API_URL}/core/system/syscode/add`,
			name: "添加",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},

		queryDetail: {
			url: `${config.API_URL}/core/system/syscodeDetail/queryDetailList`,
			name: "批量查询",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},

		batchUpdate: {
			url: `${config.API_URL}/core/system/syscodeDetail/batchUpdate`,
			name: "批量更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		motorUseSetDetail: {
			url: `${config.API_URL}/core/system/motorUseSet/queryDetailList`,
			name: "批量查询1",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		motorUseSetUpdate: {
			url: `${config.API_URL}/core/system/motorUseSet/batchUpdate`,
			name: "批量更新1",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		addRecords: {
			url: `${config.API_URL}/core/system/syscode/addRecords`,
			name: "批量添加材料字典",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		batchUpdateRecords: {
			url: `${config.API_URL}/core/system/syscode/batchUpdate`,
			name: "批量更新材料字典",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		viewDetailList: {
			url: `${config.API_URL}/core/system/syscode/viewDetailList`,
			name: "批量查看材料字典",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},






	},
	//模块
	menu: {
		add: {
			url: `${config.API_URL}/main/system/menu/add`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		detail: {
			url: `${config.API_URL}/core/system/menu/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/core/system/menu/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/core/system/menu/update`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		InitChild: {
			url: `${config.API_URL}/core/system/menu/queryChildMenuList`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			},
		},
		updateChild: {
			url: `${config.API_URL}/core/system/menu/updateChildMenuList`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			},
		},
		moduleTree: {
			url: `${config.API_URL}/core/reportCoreService/query`,
			name: "模块树状图",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		iconList: {
			url: `${config.API_URL}/main/system/menu/getModuleIconList`,
			name: "图标列表",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		routerList: {
			url: `${config.API_URL}/core/system/menu/queryUserMenuList`,
			name: "路由列表",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		}



	},
	//定时器
	quartz: {
		detail: {
			url: `${config.API_URL}/core/quartz/schedulejob/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/core/quartz/schedulejob/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/core/quartz/schedulejob/update`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},

		add: {
			url: `${config.API_URL}/core/quartz/schedulejob/add`,
			name: "添加",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		}



	},
	//角色管理
	role: {
		add: {
			url: `${config.API_URL}/core/system/role/add`,
			name: "添加",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/core/system/role/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		detail: {
			url: `${config.API_URL}/core/system/role/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/core/system/role/update`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
	},
	user: {
		add: {
			url: `${config.API_URL}/core/system/user/add`,
			name: "添加",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/core/system/user/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		detail: {
			url: `${config.API_URL}/core/system/user/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/core/system/user/update`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
	},
	//数据权限
	datapermission: {
		add: {
			url: `${config.API_URL}/core/system/datapermission/add`,
			name: "添加",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/core/system/datapermission/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		detail: {
			url: `${config.API_URL}/core/system/datapermission/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/core/system/datapermission/update`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
	},
	//内容管理
	content: {
		add: {
			url: `${config.API_URL}/core/system/content/add`,
			name: "添加",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/core/system/content/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		detail: {
			url: `${config.API_URL}/core/system/content/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/core/system/content/update`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		deleteFile: {
			url: `${config.API_URL}/core/system/content/deleteFile`,
			name: "删除单个附件",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		editDtList: {
			url: `${config.API_URL}/core/system/content/editDtlList`,
			name: "初始化明细记录",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		updateDtList: {
			url: `${config.API_URL}/core/system/content/updateDtlList`,
			name: "批量修改明显记录",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},

	},
	//信息发布
	notice: {
		add: {
			url: `${config.API_URL}/core/system/notice/add`,
			name: "添加",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/core/system/notice/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		detail: {
			url: `${config.API_URL}/core/system/notice/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/core/system/notice/update`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		getNoticeList: {
			url: `${config.API_URL}/core/system/notice/getNoticeList`,
			name: "获取信息列表",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		read: {
			url: `${config.API_URL}/core/system/notice/updateNoticeReadStatus`,
			name: "已读",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		}
		
		
	},
	//资源文件
	resourcefile: {
		add: {
			url: `${config.API_URL}/core/meta/resourcefile/add`,
			name: "添加",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/core/meta/resourcefile/save`,
			name: "保存",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		detail: {
			url: `${config.API_URL}/core/meta/resourcefile/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		update: {
			url: `${config.API_URL}/core/meta/resourcefile/update`,
			name: "更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		delete: {
			url: `${config.API_URL}/core/meta/resourcefile/delete`,
			name: "删除",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		batchUpdate: {
			url: `${config.API_URL}/core/meta/resourcefile/batchUpdate`,
			name: "批量更新",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		batchEdit: {
			url: `${config.API_URL}/core/meta/resourcefile/batchEdit`,
			name: "批量修改",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
	},
	//excel导入
	excel: {
		readSheetList: {
			url: `${config.API_URL}/core/report/importExcel/readSheetList`,
			name: "读取sheet列表",
			post: async function (data) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		readSheetData: {
			url: `${config.API_URL}/main/report/importExcel/readSheetData`,
			name: "读取sheet数据",
			post: async function (data) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		import: {
			url: `${config.API_URL}/core/report/importExcel/importData`,
			name: "导入数据",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		create: {
			url: `${config.API_URL}/core/report/importExcel/create`,
			name: "初始",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		validate: {
			url: `${config.API_URL}/core/report/importExcel/validateData`,
			name: "验证",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		configSave: {
			url: `${config.API_URL}/core/report/importExcel/config/save`,
			name: "验证",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
			}
		},
		configAdd: {
			url: `${config.API_URL}/core/report/importExcel/config/add`,
			name: "初始",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		configDetail: {
			url: `${config.API_URL}/core/report/importExcel/config/detail`,
			name: "初始",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		configUpdate: {
			url: `${config.API_URL}/core/report/importExcel/config/update`,
			name: "修改",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		searchConfigFiles: {
            url: `${config.API_URL}/core/report/importExcel/config/queryDatasetList`,
            name: "搜索系统下配置路径及文件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,  config);
            }
        },
	},
	//日志
	log: {
		detail: {
			url: `${config.API_URL}/core/system/sysLog/detail`,
			name: "查看",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, config);
			}
		}
	},
}
